import csv

def save_csv(path,rowList):
    with open(path,'w',newline="") as csvfile:
        writer = csv.writer(csvfile)
        writer.writerows(rowList)
        
def getCSVList(data):
    """
    将Node列表转化为保存为csv文件需要的列表
    输入：Node列表
    输出：方便保存csv的列表
    """
    rowList = []
    rowList.append(list(data[0]['node'].keys()))
    for res in data:
        node = res['node']
        rowList.append(list(node.values()))
    return rowList